package it.koutifaris.travianmap.ui.animation;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class TestScheduler implements Scheduler {

	private final ScheduledExecutorService scheduleTaskExecutor;

	public TestScheduler() {
		scheduleTaskExecutor = Executors.newScheduledThreadPool(1);
	}

	@Override
	public void scheduleNow(Runnable action) {
		scheduleTaskExecutor.schedule(action, 1, TimeUnit.MILLISECONDS);
	}

	@Override
	public void scheduleDelayed(Runnable action, long delayMillis) {
		scheduleTaskExecutor.schedule(action, delayMillis, TimeUnit.MILLISECONDS);
	}

}
